﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Drawing;
using System.Drawing.Imaging;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using ChoJu.Single.Views;
using ChongJu.Camera;
using ChongJu.CloudService;
using ChongJu.EventManager;
using ChongJu.EventManager.ExchangePage;
using ChongJu.GlobalInfo;
using ChongJu.ImageAnalyze;
using ChongJu.ModelManager;
using ChongJu.ModelManager.Rating;
using GalaSoft.MvvmLight.Threading;
using Public.Logger;
using Public.MvvmBase;
using Public.Tools;

namespace ChoJu.Single.ViewModel
{
    public class MainWindowVM : PropertyChangedBase
    {
        private Dictionary<int, object> _dict;

        public MainWindowVM()
        {
            _dict = new Dictionary<int, object>();
            _dict.Add(1, new RatingView());
            _dict.Add(2, new CameraView());
            _dict.Add(3, new CollectView());
            _dict.Add(4, new CalibrationView());
            _dict.Add(5, new GreyImageView());
            _dict.Add(6, new WeightView());
            PageContent = _dict[1];
            ExchangePageEvent.ExchangePageEventReportNew += ExchangePageEvent_ExchangePageEventReportNew;
        }

        private void ExchangePageEvent_ExchangePageEventReportNew(PageEnum page)
        {
            if(page == PageEnum.Main)
                PageContent = _dict[1];
            else if(page == PageEnum.Camera)
                PageContent = _dict[2];
            else if(page == PageEnum.Collect)
                PageContent = _dict[3];
            else if (page == PageEnum.Calibration)
                PageContent = _dict[4];
            else if (page == PageEnum.Grey)
                PageContent = _dict[5];
            else if (page == PageEnum.Weight)
                PageContent = _dict[6];
        }

        public object PageContent
        {
            get { return pageContent; }
            set { pageContent = value; OnPropertyChanged(() => PageContent); }
        }
        private object pageContent;

       



       


        
    }
}
